﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admincp/admin.Master" AutoEventWireup="true" CodeBehind="NewsClassify.aspx.cs" Inherits="xyw.admincp.NewsClassify" %>
<%@ Register src="Controls/UC_SecondNews.ascx" tagname="UC_SecondNews" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderSecond" runat="server">
    <uc1:UC_SecondNews ID="UC_SecondNews1" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContents" runat="server">
    <div id="main">
      <div class="quick-actions">
  <a href="#" onclick="displayBox()"><span class="glyph new"></span>新增新闻分类</a>
</div>
      <div class="box">
  <div class="box-header">
    <h1>新闻分类</h1>
  </div>

  <table>
    <thead>
      <tr>
        <th>分类名称</th>
        <th>新闻总数</th>
        <th>详情</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
        <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
            <ItemTemplate>
<tr>
        <td><%# Eval("classifyName") %></td>
        <td>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:HiddenField ID="HiddenField1" runat="server" Value=<%# Eval("classifyName") %> />
        </td>
        <td><a href="News.aspx?classify=<%# Eval("classifyName") %>"><%# Eval("classifyName") %></a></td>
        <td>
          <a href="#" onclick="Edit(<%# Eval("ID") %>,'<%# Eval("classifyName") %>')" class="button plain">编辑</a>
            <asp:LinkButton ID="LinkButton1" OnClientClick="return confirm('确定删除吗？')" CssClass="button plain" CommandArgument=<%# Eval("ID") %> CommandName="Delete" runat="server">删除</asp:LinkButton>
          
        </td>
      </tr>
            </ItemTemplate>
        </asp:Repeater>
      
    </tbody>
  </table>
</div>
      
        <div class="box" id="modal">
  <div class="box-header">
    <h1></h1>
  </div>
  
  <div class="box-content">
    <p>分类名称：<asp:HiddenField ID="hd_Id" runat="server" Value="0" />
        <asp:TextBox ID="txt_classifyName" runat="server" CssClass="{validate:{required:true, minlength:3}}"></asp:TextBox>
    </p>
    
    <div class="action_bar">
        <asp:Button ID="Button1" CssClass="button blue" runat="server" Text="保存" OnClick="Button1_Click" />
    </div>
  </div>
</div>
      </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderScript" runat="server">
    <script>
        $(document).ready(function () {
            $("#modal").hide();
        })
        function displayBox() {
            $("#<%=hd_Id.ClientID%>").val(0);
            $("#<%=txt_classifyName.ClientID%>").val("");
            $("#modal").slideToggle();
        }
        function Edit(id,name) {
            $("#modal").slideDown();
            $("#<%=hd_Id.ClientID%>").val(id);
            $("#<%=txt_classifyName.ClientID%>").val(name);
        }
        
    </script>
</asp:Content>
